<%@ page language="java" import="com.bifrii.bo.*,com.bifrii.transferObjects.*,com.bifrii.dao.*,java.util.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<jsp:include page="/header.jsp" />
<% 
	
List<User> users = CommunityManager.getInstance().getCommunityUsers(Integer.parseInt(request.getParameter("id")));
Community c = CommunityManager.getInstance().getCommunity(Integer.parseInt(request.getParameter("id")));
List<Event> events = CommunityManager.getInstance().getCommunityEvents(Integer.parseInt(request.getParameter("id")));
%>

<div id="content-left">

<div class="box">
		<div class="avatar"><img src="img/communities/<%=c.getAvatar() %>"/></div>
		<div class="title"><%=c.getName() %></div>
		<div class="description"><%=c.getDescription()%></div>
		<div class="info"></div>
		<div class="clear"></div>
	</div>

<div class="box" id="related">
	<div class="title">Eventos de la comunidad</div>
	<ul><%
	for(Event e: events){
	%>
	<li><a href="FrontController?res=indexEvent.jsp&id=<%=e.getIdEvent() %>"><%=e.getName()%></a></li>
	<%
	}
	%>
	</ul>
</div>

</div>
<div id="content-right">
	
	<div class="module">
		<div class="module-title">Usuarios de esta comunidad</div>
		<div class="module-content">
			<ul>
			<%
	         for(User u: users){
	       	%>
	        	 <li><a href="FrontController?res=indexUser.jsp&id=<%=u.getIdUser() %>"><%=u.getUser() %></a></li>
	        <%
	         }
	        %>
	         </ul>
		</div>
	</div>
</div>
<jsp:include page="/footer.html" />